
import cn.ac.iie.di.gloabl.GlobalParas;
import cn.ac.iie.di.msg.JsonMsgSender;
import cn.ac.iie.di.tools.JsonSplitor;
import com.trs.ckm.soap.ABSResult;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.junit.Test;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author Austin
 */
public class AClass {

    public static ArrayBlockingQueue<String> msgQueue = new ArrayBlockingQueue(500);

    public static void main(String[] args) {

        String ss = "2017-01-19 10:50:16,505 [ERROR] [cn.ac.iie.di.msg.JsonMsgTask.run(JsonMsgTask.java:296)] [JsonMsgTask_6] - The session add is wrong:com.trs.ckm.soap.CkmSoapException: http://10.136.65.34:8000\n"
                + "java.net.SocketException: Connection reset";
        String ip = ss.substring(ss.indexOf("http:"), ss.indexOf("http:") + 24);
        String IP_TRS="http://10.136.65.34:8000;http://10.136.65.35:8000;http://10.136.65.36:8000;http://10.136.65.37:8000;http://10.136.65.38:8000;http://10.136.65.39:8000;http://10.136.65.40:8000;http://10.136.65.41:8000;http://10.136.65.42:8000;http://10.136.65.43:8000;http://10.136.65.44:8000;http://10.136.65.45:8000;http://10.136.65.46:8000;http://10.136.65.47:8000;http://10.136.65.48:8000;http://10.136.65.49:8000;http://10.136.65.50:8000;http://10.136.65.51:8000";
        
        String trs = IP_TRS.replace(ss.substring(ss.indexOf("http:"), ss.indexOf("http:") + 24), "");
        System.out.println(trs);

    }

    public static String getException(Exception e) {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        PrintStream pout = new PrintStream(out);
        e.printStackTrace(pout);
        String ret = new String(out.toByteArray());
        pout.close();
        try {
            out.close();
        } catch (IOException ex) {
            Logger.getLogger(AClass.class.getName()).log(Level.SEVERE, null, ex);
        }

        return ret;
    }
}
